﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="renewal-lead-list.aspx.cs" Inherits="carinsurance_renewal_lead_list" %>

<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="Server">
    <title>
        Renewal Leads
        - GG-CRM - กล้วยๆ.com - Teledirect Thailand</title>
    <link rel="Stylesheet" type="text/css" href="renewal/magnific-popup/jquery-ui.css" />
    <style type="text/css">
        .hiddencol
        {
            display: none;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPageTitle" runat="Server">
<div style="width:100%; float:left;">
<div style="float:left; width:700px"><h1>
        <asp:Label runat="server" Text="<%$Resources:General,RenewalQuotesSummary%>" ID="lblPageName"></asp:Label></h1></div>
    <div style="float:right"><input id="btnSearch" class="blueB ml10" value="Renewal Search" type="button" onclick="openSearch();" /></div>
</div>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Label runat="server" Text="<%$Resources:General,LangOption%>" Visible="false"
        ID="lblLangOption" />
    <div class="" style="width:100%; float:left; margin-top:20px;">
    <div id="tabs">
        <ul style="padding: 0; margin: 0;">
            <li class="context-tab"><a id="tabmonth0" href="#ui-tabs-0">>>></a></li>
            <li class="context-tab"><a id="tabmonth1" href="renewal/renewal-notice-list.aspx?tab=1"><span id="lblMonth1"></span></a></li>
            <li class="context-tab"><a id="tabmonth2" href="renewal/renewal-notice-list.aspx?tab=2"><span id="lblMonth2"></span></a></li>
            <li class="context-tab"><a id="tabmonth3" href="renewal/renewal-notice-list.aspx?tab=3"><span id="lblMonth3"></span></a></li>
            <li class="context-tab"><a id="tabmonth4" href="renewal/renewal-notice-list.aspx?tab=4"><span id="lblMonth4"></span></a></li>
            <li class="context-tab"><a id="tabmonth5" href="renewal/renewal-notice-list.aspx?tab=5"><span id="lblMonth5"></span></a></li>
            <li class="context-tab"><a id="tabmonth6" href="renewal/renewal-notice-list.aspx?tab=6"><span id="lblMonth6"></span></a></li>
        </ul>
        <div id="ui-tabs-0">
            โปรดเลือกเดือนที่ต้องการ!</div>
        <iframe class="frameToChange" style="display: none" ></iframe>
    </div>
    </div>
    <script type="text/javascript">
        $(document).ready(function() {
            var monthN = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];

            var i = 0;
            for (i = -2; i <= 3; i++) {
                var d = new Date();
                d.setDate(1);
                d.setMonth(d.getMonth() + i);
                document.getElementById("lblMonth" + (i + 3)).innerHTML = monthN[d.getMonth()] + " " + d.getFullYear();
            }


        });
        
        function CheckLinkExist(obj) {
            var IsExist = false;
            var http = new XMLHttpRequest();
            http.open('HEAD', obj.href, false);
            http.send();

            if (http.status != 404) {
                IsExist = true;
            }
            else {
                alert("No file found!");
            }
            return IsExist;
        }

//        var j$ = jQuery.noConflict();
//        var frames = j$('.frameToChange');
//        j$(this).slideDown('fast');
//        j$(this).attr('src', "renewal/renewal-notice-list.aspx?tab=" + ui.index);
        
        $(function() {
            $("#tabs").tabs({
                //panelTemplate: "<iframe style='width:100%'></iframe>",
                idPrefix: "ui-tabs-",
                select: function(event, ui) {
                    if (!$("#ui-tabs-" + ui.index).prop("src")) {
                        //$("#ui-tabs-" + ui.index).attr("src", $.data(ui.tab, 'load.tabs'));
                        $("#ui-tabs-" + ui.index).load($("#ui-tabs-" + ui.index).prop("src")); //"renewal/renewal-notice-list.aspx?tab=" + ui.index
                    }
                }
            });
        });

        function getRandomInt(min, max) {
            return Math.floor(Math.random() * (max - min)) + min;
        }

        function openSearch() {
            window.open('RenewalQuotes.aspx', '_blank');
        }

//        $(function() {
//            $("#tabs").tabs({
//                beforeLoad: function(event, ui) {
//                    ui.jqXHR.error(function() {
//                        ui.panel.html("Couldn't load this tab. We'll try to fix this as soon as possible. " +
//                            "If this wouldn't be a demo.");
//                    });
//                }
//            });
//        });

//        $(document).ready(function() {
//            $("#ajax-content").empty().append("<div id='loading'><img src='../images/loaders/loader8.gif' alt='Loading' /></div>");
//                $.ajax({ url: 'renewal/renewal-notice-list.aspx', success: function(html) {
//                    $("#ajax-content").empty().append(html);
//                }
//            });
//        });

//        $("#nav li a").click(function() {
//            $("#ajax-content").empty().append("<div id='loading'><img src='../images/loading.gif' alt='Loading' /></div>");
//            $("#nav li a").removeClass('current');
//            //$(this).addClass('current');
//            var $this = $(this);
//            $this.addClass('current');
//            $.ajax({ url: this.href, success: function(html) {
//                location.hash = $.trim($this.text().toLowerCase());
//                $("#ajax-content").empty().append(html);
//            }
//            });
//            return false;
//        });

//        $(function() {
//            $("#tabs").tabs({
//                beforeLoad: function(event, ui) {
//                    ui.jqXHR.error(function() {
//                        ui.panel.html(
//                "Couldn't load this tab. We'll try to fix this as soon as possible. " +
//                "If this wouldn't be a demo.");
//                    });
//                }
//            });
//        });

//        $(function() {
//            $("#tabs").tabs({
//                beforeLoad: function(event, ui) {
//                    ui.jqXHR.error(function() {
//                        ui.panel.html("Couldn't load this tab. We'll try to fix this as soon as possible. " +
//                            "If this wouldn't be a demo.");
//                    });
//                }
//            });
//        });

//        $(document).ready(function() {
//            $('#tabs').tabs({ event: 'mouseover' });
//            $('#tabs ul li a').click(function() {
//                location.href = this.rel;
//            });
//        });

    </script>
</asp:Content>